package com.wen.springboot_db_20210510.controller;

import com.wen.springboot_db_20210510.beans.UserInfo;
import com.wen.springboot_db_20210510.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class TestUserControl {

    @Autowired
    IUserService service;

    @ResponseBody
    @RequestMapping("login")
    public List<UserInfo> testUser(Model model) {
        return service.getAllUser();
    }
}
